﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;


static class Literal
{
    static List<string> SaveBox = new List<string>();//リテラル避難用

    public static void Move(ref string Code)
    {
        Regex mm = new Regex(@"(@""([^""]|"""")*"")|(""([^\\""]|\\.)*"")");
        while(mm.Match(Code).Success == true)//見つかる間
        {
            Match m = mm.Match(Code);

            SaveBox.Add(m.Value);

            #region debug
#if DEBUG
            Console.WriteLine("[Literal]{0}",SaveBox[SaveBox.Count-1]);
#endif
            #endregion

            Code = Code.Remove(m.Index, m.Length);
            Code = Code.Insert(m.Index, "LITERAL<" + SaveBox.Count + ">");
        }
    }
}